#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h> 
#include  <assert.h>
int main1()
{

	int arr1[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int arr2[30] = { 0 };
	memcpy(arr2, arr1 + 3, 20);



	return 0; 
}

void My_memcpy(void* dest, const void* src, size_t num)
{
	void* ret = dest; 
	assert(dest && src);
	int i = 0; 
	for (i = 0; i < num; i++)
	{
		(*(char*)dest) = (*(char*)src);
			dest = (char*)dest + 1;
			src = (char*)src + 1;

	}
	return ;


 }

int main2()
{

	int arr1[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int arr2[30] = { 0 };
	 My_memcpy(arr1, arr1 + 3, 10);
	return 0;
}
int main3()
{


	int arr1[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int arr2[30] = { 0 };
	memmove(arr1, arr1 + 2, 20);
	return 0;

	
}

void My_memmove(void* dest, const void* src, size_t num)
{
	void* ret = dest; 
	assert(dest && src);
	if (dest > src)
	{
		while (num--)
		{
			 (*(char* )dest )= 
			dest = (*(char *)dest) + 1;
		src = (*(char*)src) + 1;



		}
	}



 }
int main()
{


	int arr1[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int arr2[30] = { 0 };
	My_memmove(arr1, arr1 + 2, 20);
	return 0;


}